#include "windowlpc.h"
#include "ui_windowlpc.h"
#include <QDebug>

WindowLPC::WindowLPC(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::WindowLPC)
{
    ui->setupUi(this);
}

WindowLPC::WindowLPC(std::vector<double> &ti, std::vector<std::vector<double> > &ar, QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::WindowLPC)
{
    ui->setupUi(this);
    ui->textBrowser->clear(); // clear 清空文本框
    QString tmpText = "";

    tmpText += "time | LPC\n";
    qDebug() << ti.size() << " " << ar.size() << "\n";
    for (uint i = 0; i < ti.size(); ++ i) {

        tmpText += QString::number(ti[i]) + " | ";
        for (uint j = 0; j < ar[i].size(); ++ j) {
            tmpText += QString::number(ar[i][j]) + " ";
        }
        tmpText += "\n";
    }
    ui->textBrowser->append(tmpText);
}

WindowLPC::~WindowLPC()
{
    delete ui;
}
